package com.example.warehouse_manager.service.impl;

import com.example.warehouse_manager.entity.Place;
import com.example.warehouse_manager.entity.Result;
import com.example.warehouse_manager.mapper.PlaceMapper;
import com.example.warehouse_manager.service.PlaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Yang
* @description 针对表【place(产地)】的数据库操作Service实现
* @createDate 2024-03-22 14:06:05
*/
@CacheConfig(cacheNames = "com.example.warehouse_manager.service.impl.PlaceServiceImpl")
@Service
public class PlaceServiceImpl implements PlaceService{

    @Autowired
    private PlaceMapper placeMapper;

    //查询所有产地
    @Cacheable(key = "'all:place'")
    @Override
    public List<Place> queryAllPlace() {
        return placeMapper.findAllPlace();
    }
}




